package com.aliyun.thread;


import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;

import com.aliyun.service.YuMingService;
import com.aliyun.util.HttpClientUtil;

/**
 */
public class YuMingCheckThread extends Thread {

	@Resource(name = "yumingService")
	private YuMingService yumingService;
	private Map<String, Object> map;
	
	public YuMingCheckThread(Map<String, Object> map) {
		this.map = map;
	}

	@Override
	public void run() {
		
		HttpClientUtil hcUtil = HttpClientUtil.getInstance();
		String status = hcUtil.checkInetAddress(map);
		Map<String,String> updateMap = new HashMap<String,String>();
		updateMap.put("status", status);
		updateMap.put("name", map.get("name")+"");
		try {
			yumingService.updateYuMingStatus(updateMap);
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
